package com.zhisuo.apicenter.model;

import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

public class ZhiSuoCarRowMapper implements RowMapper<ZhiSuoCar> {

    @Override
    public ZhiSuoCar mapRow(ResultSet rs, int rowNum) throws SQLException {
        ZhiSuoCar car = new ZhiSuoCar();
        car.setId(rs.getInt("id"));
        car.setName(rs.getString("name"));
        car.setType(rs.getInt("type"));
        car.setSn(rs.getString("sn"));
        car.setCreate_time(rs.getTimestamp("create_time"));
        car.setStatus(rs.getInt("status"));
        car.setHomestation(rs.getString("homestation"));
        return car;
    }

}
